#include "ex_12Test.h"

int main(int argc, char **argv)
{
	::testing::InitGoogleTest(&argc, argv);
	int i = RUN_ALL_TESTS();
	system("pause");
	return i;
}

TEST_F(RationalTest, DefaultCtorWork)
{
	ASSERT_EQ(def_rational.get_num(), 1);
	ASSERT_EQ(def_rational.get_denum(), 1);
}

TEST_F(RationalTest, CtorWork)
{
	for (int i = -100; i < 101; ++i)
		for (int j = -100; j < 101; ++j)
		{
			if (j <= 0 ) 
				ASSERT_THROW(Rational (i, j), std::exception);
			else
			{
				ASSERT_NO_THROW(Rational (i, j));		
				Rational r(i,j);
				ASSERT_EQ(r.get_num(),i);
				ASSERT_EQ(r.get_denum(),j);
			}
		}
}
